package com.wangcanxuan.www.controller.Impl;

import com.wangcanxuan.www.controller.LikeController;
import com.wangcanxuan.www.entity.dto.ResultInfo;
import com.wangcanxuan.www.proxy.ServiceProxy;
import com.wangcanxuan.www.service.Impl.LikeServiceImpl;
import com.wangcanxuan.www.service.LikeService;

/**
 * 点赞controller层实现类
 *
 * @author HHLJ
 * @date 2022/04/08
 */
public class LikeControllerImpl implements LikeController {

    private final LikeService likeService = ServiceProxy.getProxyInstance(LikeServiceImpl.class);

    @Override
    public ResultInfo<String> likePeople(String userId, String chooseName) {
        ResultInfo<String> resultInfo = likeService.likePeople(userId, chooseName);
        if (resultInfo.isSuccess()) {
            resultInfo.setMessage("点赞成功！");
        }
        return resultInfo;
    }

    @Override
    public ResultInfo<Long> selectLikesForUser(String userId) {
        return likeService.selectLikesForUser(userId);
    }
}
